package ipad.asia.controller;

import ipad.asia.entity.Express;
import ipad.asia.service.express.ExpressFeign;
import ipad.asia.service.product.ProductFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class ExpressController {
    @Autowired
    private ExpressFeign expressFeign;
    @Autowired
    private ProductFeign productFeign;
    @RequestMapping("/express")
    public String express(@RequestParam(value = "orderId",required = false)String orderId){
        Express byOrderId = expressFeign.findByOrderId(Integer.parseInt(orderId));
        String com=byOrderId.getExpressName();
        String number=byOrderId.getExpressNumber();
        return "redirect:https://www.kuaidi100.com/chaxun?com="+com+"&nu="+number;
    }

}
